package vh.sphynx.valueconverter;

import org.eclipse.xtext.conversion.ValueConverterException;
import org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter;
import org.eclipse.xtext.nodemodel.INode;

public class VERBATIM_STRINGValueConverter extends
		AbstractLexerBasedConverter<String> {

	public String toValue(String string, INode node)
			throws ValueConverterException {
		if (string == null)
			return null;
		try {
			return string.substring(2, string.length() - 1);
		} catch (IllegalArgumentException e) {
			throw new ValueConverterException(e.getMessage(), node, e);
		}
	}

}
